﻿//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using Top.Api;
//using Top.Api.Request;
//using Top.Api.Response;

//namespace Utilities
//{
//    public class SMSHelper
//    {
//        /*http://www.alidayu.com/
//        lyzhongzhilong@qq.com
//        momochong0
//        App Key:
//        23393709
//        App Secret:
//        586fae2a4e7d1141ace6976c9ccdee7e */
//        private string url = "http://gw.api.taobao.com/router/rest";
//        private string appkey = System.Configuration.ConfigurationManager.AppSettings.Get("AppKey");
//        private string appSecret = System.Configuration.ConfigurationManager.AppSettings.Get("AppSecret");
//        public string SendRegisterSMS(string mobile, string code)
//        //{
//            ITopClient client = new DefaultTopClient(url, appkey, appSecret, Constants.FORMAT_JSON);
//            AlibabaAliqinFcSmsNumSendRequest req = new AlibabaAliqinFcSmsNumSendRequest();
//            req.Extend = "123456";
//            req.SmsType = "normal";
//            req.SmsFreeSignName = "注册验证";
//            req.SmsParam = "{\"code\":\"" + code + "\",\"product\":\"检查站\"}";
//            req.RecNum = mobile;
//            req.SmsTemplateCode = "SMS_11055109";

//            AlibabaAliqinFcSmsNumSendResponse rsp = client.Execute(req);
//            return rsp.Body;
//        }



//        public string SendFindPwdSMS(string mobile, string code)
//        {
//            ITopClient client = new DefaultTopClient(url, appkey, appSecret, Constants.FORMAT_JSON);
//            AlibabaAliqinFcSmsNumSendRequest req = new AlibabaAliqinFcSmsNumSendRequest();
//            req.Extend = "123456";
//            req.SmsType = "normal";
//            req.SmsFreeSignName = "身份验证";
//            req.SmsParam = "{\"code\":\"" + code + "\",\"product\":\"找回密码\"}";
//            req.RecNum = mobile;
//            req.SmsTemplateCode = "SMS_11055113";

//            AlibabaAliqinFcSmsNumSendResponse rsp = client.Execute(req);
//            return rsp.Body;
//        }

//        /*更改手机身份验证*/
//        public string SendChangMobileSMS(string mobile, string code)
//        {
//            ITopClient client = new DefaultTopClient(url, appkey, appSecret, Constants.FORMAT_JSON);
//            AlibabaAliqinFcSmsNumSendRequest req = new AlibabaAliqinFcSmsNumSendRequest();
//            req.Extend = "123456";
//            req.SmsType = "normal";
//            req.SmsFreeSignName = "变更验证";
//            req.SmsParam = "{\"code\":\"" + code + "\",\"product\":\"检查站\"}";
//            req.RecNum = mobile;
//            req.SmsTemplateCode = "SMS_11055106";

//            AlibabaAliqinFcSmsNumSendResponse rsp = client.Execute(req);
//            return rsp.Body;
//        }
//        /// <summary>
//        /// 方法一，生成随机数。
//        /// </summary>
//        /// <param name="s">接收生成的随机数</param>
//        /// <returns>生成的随机数</returns>
//        private string random_1()
//        {
//            string s = string.Empty;
//            Random rm = new Random();
//            for (int i = 0; i < 4; i++)
//            {
//                int k = rm.Next();
//                char j = (char)('0' + (char)(k % 10));
//                s += j.ToString();
//            }
//            return s;
//        }
//    }
//}
